<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.kylin.module.shop.business.*,
				 com.kylin.module.shop.orm.*,
				 com.kylin.common.Constants,
				 com.kylin.module.user.orm.*,
				 com.kylin.common.dict.orm.Dict,
				 com.kylin.common.util.*,
				 com.kylin.module.community.orm.*" %>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/pageExpires.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<div class="boxtitle"><bean:message key="head.subad"/></div>
<div class="box"><br>
  <br>
  <script type="text/javascript" src="/script/validate.js"></script>
  <form action="/module/subscibe/subUser.do?CMD=addSub" method="post" name="theForm" onsubmit="return checkForm(this);">
  <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="2">
    <tr>
      <td width="160" align="right"><span class="notice">*</span><bean:message key="sub.cate"/>：</td>

      <td><input type="checkbox" name="subtypeId" value="1"  check="^\S+$" warning="请至少选择一种信息">
        <bean:message key="head.10"/><input type="hidden" name="subtypeName" value="产品">
          <input type="checkbox" name="subtypeId" value="2">
        <bean:message key="head.11"/><input type="hidden" name="subtypeName" value="贸易信息">
        <input type="checkbox" name="subtypeId" value="3">
        <bean:message key="head.13"/><input type="hidden" name="subtypeName" value="会展">
      </td>
    </tr>
        <tr align="left">
          <td align="right"><bean:message key="sub.type"/>:<br></td>
          <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="28%">
              <%

    			  List maincatproduct = MemObjFactory.getDict("产品类别",sessionLocale.toString());
                  StringBuffer sb1 = new StringBuffer();
                  StringBuffer sb2 = new StringBuffer();
                  for(int i=0;i<maincatproduct.size();i++){
                  	  Dict dict = (Dict)maincatproduct.get(i);
                      if(dict.getParent() == null){
                          sb1.append("\n<option value='").append(dict.getName()).append("'>");
                          sb1.append(dict.getName()).append("</option>");
                      }else{
                      	 if(sb2.length() > 1)
                      	     sb2.append(",");
                         sb2.append("\n  new SubSelectObj('").append(dict.getName()).append("','");
                         sb2.append(dict.getParent().getName()).append("','");
                         sb2.append(dict.getName()).append("')");
                      }
                  }
              %>
              
              <select name="fkCatDictId" id="parentSelect" onchange="setSub(this.value)">
              
              	<%=sb1%>
              </select>
			</td>
            <td width="72%">
             <select name="fkDictsId" id="subSelect" size="4" style="width:100px;" multiple="true"  check="^\S+$" warning="请至少选择一种分类">
             </select>
       <script src="/script/kylin.js"></script>
       <script>
		var subArray= new Array(<%=sb2%>); 
		function setSub(pid){
			var subSelcet = document.getElementById("subSelect");
			setSubSelect(subArray,subSelcet,pid);
		}
		setSub(document.getElementById("parentSelect").value);
       </script>       
              </td>
            </tr>
          </table>
</td>
        </tr>
    <tr>
      <td align="right"><span class="notice">*</span><bean:message key="sub.region"/>：</td>

      <td><input type="checkbox" name="subplaceId" value="1" check="^\S+$" warning="请至少选择一个区域">
        亚洲<input type="hidden" name="subplaceName" value="亚洲">
          <input type="checkbox" name="subplaceId" value="2">
          欧洲<input type="hidden" name="subplaceName" value="欧洲">
          <input type="checkbox" name="subplaceId" value="3">
          非洲<input type="hidden" name="subplaceName" value="非洲">
          <input type="checkbox" name="subplaceId" value="4">
          北美洲<input type="hidden" name="subplaceName" value="北美洲">
          <input type="checkbox" name="subplaceId" value="5">
         拉丁美洲<input type="hidden" name="subplaceName" value="拉丁美洲">
          <input type="checkbox" name="subplaceId" value="6">
        北极洲<input type="hidden" name="subplaceName" value="北极洲">
          <input type="checkbox" name="subplaceId" value="7">
          南极洲<input type="hidden" name="subplaceName" value="南极洲">
</td>

    </tr>
    <tr>
      <td align="right"><span class="notice">*</span><bean:message key="sub.time"/>：</td>
      <td><select name="subtimename">
       <option value="每周接收"><bean:message key="sub.weekly"/></option>
       <option value="每月接收" selected><bean:message key="sub.monthly"/></option>
                  </select>
 </td>
    </tr>
    <tr>
      <td align="right"><span class="notice">*</span><bean:message key="company.01"/>：</td>
      <td><input name="companyname" type="text" size="40" check="^\S+$" warning="请输入公司名称">
     </td>
    </tr>
    <tr>
      <td align="right"><span class="notice">*</span><bean:message key="company.21"/>：</td>
      <td><input name="linkmans" type="text" size="40" check="^\S+$" warning="请输入联系人姓名">&nbsp;&nbsp;
        <select name="gender">
        	<option value="1" selected>先生</option>
        	<option value="0">女士</option>
        </select>
        &nbsp;&nbsp;
        <mytag:select name="fkPositionId" notEmpty="true" dictName="<%=dict_position%>"/>
    </td>
    </tr>
    <tr>
      <td align="right"><span class="notice">*</span><bean:message key="community.country"/>：</td>
      <td align="left"><input type="hidden" name="email" value="<%=request.getParameter("usertake")%>"/><mytag:national name="country" notEmpty="true" 
                  value="<%=UTool.getCountryName(String.valueOf(sessionLocale),sessionLocale)%>" dictName="<%=Constants.ALLCOUNTRY%>"/>
    </td>
    </tr>
    <tr>
      <td align="right"><bean:message key="company.18"/>：</td>
      <td><mytag:select name="mainbussiness" notEmpty="true" dictName="主营业务" /></td>
    </tr>
    <tr>
      <td align="right"><bean:message key="company.22"/>：</td>
      <td><input name="countryphone" type="text" size="10">
      <input name="areaphone" type="text" size="10">
      <input name="phone" type="text" size="10">
      </td>
    </tr>

    <tr align="center" valign="bottom">
      <td height="40" colspan="2">
      	<input class="rinput" type="submit" name="Submit" value="<bean:message key="head.subbutton"/>"  onclick="return checkSubmit()">
      </td>
    </tr>
  </table>
  </form>
  <p>&nbsp;</p>
</div>


